import { SetAspect } from "@/tools/initSystem.tool";
import { PerspectiveCamera } from "three";

class MainCamera {
  mesh: PerspectiveCamera;
  constructor() {
    this.mesh = new PerspectiveCamera(60, SetAspect(), 0.1, 20000);
  }
  init() {
    this.mesh.name = "mainCamera";
    this.mesh.position.set(500, 200, 200);
    this.mesh.lookAt(0, 0, 0);
    this.mesh.castShadow = true;

    window.addEventListener("resize", () => {
      this.mesh.aspect = SetAspect();
      this.mesh.updateProjectionMatrix();
    });
  }
}
export const mainCamera = new MainCamera();

